Providing consistent tenant experiences for multi-tenant databases

ABSTRACT

The present invention extends to methods, systems, and computer program products for providing consistent tenant experiences at multi-tenant database. Embodiments of the invention include an import service that facilitates data imports without any distribution logic on a tenant. A tenant (caller) provides data in essentially any order. The import service understands the distribution of data across multiple databases and determines for any given piece of import data what database the import data is to be inserted into. Accordingly, the tenant (caller) is relieved from having to know how the data is distributed across a set (of potentially hundreds or thousands) of databases. The import service can optimize an import process to provide load balancing and fairness across a dynamic distributed database system. For example, the import service can insure that a large import by one tenant does not deprive the import other tenants of appropriate resources.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of and claims the benefit of andpriority to U.S. patent application Ser. No. 14/144,412, entitled“Providing Consistent Tenant Experiences For Multi-Tenant Databases”,filed Dec. 20, 2013 by Scott Anthony Konersmann, the entire contents ofwhich are expressly incorporated by reference.

BACKGROUND Background and Relevant Art

Computer systems and related technology affect many aspects of society.Indeed, the computer system's ability to process information hastransformed the way we live and work. Computer systems now commonlyperform a host of tasks (e.g., word processing, scheduling, accounting,etc.) that prior to the advent of the computer system were performedmanually. More recently, computer systems have been coupled to oneanother and to other electronic devices to form both wired and wirelesscomputer networks over which the computer systems and other electronicdevices can transfer electronic data. Accordingly, the performance ofmany computing tasks is distributed across a number of differentcomputer systems and/or a number of different computing environments.

In database environments, users can use tools and algorithms to loaddata into databases. These tools normally only work on a single table(or at best database) at a time. However, as databases become larger,there is a need to split data across many databases to handle the scale.When data is split, users are forced to perform various manual actionsand/or write client side code that understands the data distribution.The client code can then be executed to import data. However, each timedata is split (or subsequently merged), the client side code has to berewritten and compiled to adjust for the new distribution. Thus,adjusting for changed distributions can result in considerable work fora user.

Alternately, it is possible to write code so that data distribution canbe changed via configuration. However, it takes a configuration changeand downtime to update the system.

In many organizations, responsibilities for importing data and splittingdatabases can belong to different individuals. For example, a databaseadministrator may be responsible for maintaining an appropriate databasedistribution based on available resources. On the other hand, anapplication developer may be responsible for maintaining an applicationthat imports data into a database. Lack of communication between thedatabase administrator and application developer can result innon-functioning applications. For example, if the database administratorfails to communicate a new database distribution from splitting adatabase, a data import application may stop working. Even when theapplication developer is made aware of the split, it may take some aboutof time for the application developer to modify the data importapplication for use with the new data distribution.

In other environments, such as, for example, multi-tenant,multi-database environments, a database administrator may have nocontrol over data distribution. For example, cloud database environmentscan maintain multiple databases per tenant and can service many tenants.In a cloud database environment, modules within the cloud environmentcan automatically split and/or merge databases as appropriate. Splittingand/or merging databases can be based on a customer's needs, availableresources within the cloud environment, needs of other customer's, etc.As such, an application developer may have no way to know a datadistribution for corresponding data. Further, in a cloud environment,data distributions can change with some regularity. Thus, when adatabase is operated in a cloud environment, it can be extremelydifficult for an application developer to maintain a data importapplication.

Further, when importing data into multi-tenant, multi-databaseenvironments, import modules can be configured to import all data forone tenant before moving to import data for another tenant. Thus,tenants with larger data requirements can consume significant resourcesfor extended periods of time. Consumption of significant resources by asingle tenant is detrimental to other tenants as well as to the systemmanaging the multi-tenant, multi-database. For example, other tenantscan be preventing from importing their data until the import of largeramounts of data for another tenant completes. When a large amount ofdata is imported to a specified database within a multi-tenant,multi-database environment, resources associated with the specifieddatabase can also become overloaded. Tenants have no real motivation tolimit import data size, since they simply desire to have their own dataimported.

BRIEF SUMMARY

The present invention extends to methods, systems, and computer programproducts for providing consistent tenant experiences at multi-tenantdatabase. First data is accessed. The first data is associated with atenant of a dynamic distributed database system. The first data has aplurality of data portions, each having values (e.g., primary keyvalues) within one or more ranges of a database of the tenant. One ormore data portions, from among the plurality of data portions, areimported into the dynamic distributed database system.

For each of the one or more data portions, importing includes referringto a global partition map for the dynamic distributed database system toschedule the data portion for insertion into an appropriate database forthe tenant. The appropriate database for the tenant is at a node of thedynamic distributed database system.

Second data is accessed. The second data is associated with a secondtenant of the dynamic distributed database system. The second data hasvalues (e.g., primary key values) within one or more ranges of adatabase of the second tenant.

Import of the first data is suspended or throttled subsequent toaccessing the second data and prior to completing import of all of theplurality of data portions. Accordingly, one or more data portions, fromamong the plurality of data portions, remain to be processed.

Subsequent to suspending or throttling import of the first data into thedynamic distributed database system, a portion of the second data isimported into the dynamic distributed database system Importing theportion of second data includes referring to the global partition map toschedule the portion of the second data for insertion into appropriatedatabase for the second tenant. The appropriate database for the secondtenant is at a node of the dynamic distributed database system.

This summary is provided to introduce a selection of concepts in asimplified form that are further described below in the DetailedDescription. This Summary is not intended to identify key features oressential features of the claimed subject matter, nor is it intended tobe used as an aid in determining the scope of the claimed subjectmatter.

Additional features and advantages of the invention will be set forth inthe description which follows, and in part will be obvious from thedescription, or may be learned by the practice of the invention. Thefeatures and advantages of the invention may be realized and obtained bymeans of the instruments and combinations particularly pointed out inthe appended claims. These and other features of the present inventionwill become more fully apparent from the following description andappended claims, or may be learned by the practice of the invention asset forth hereinafter.

BRIEF DESCRIPTION OF THE DRAWINGS

In order to describe the manner in which the above-recited and otheradvantages and features of the invention can be obtained, a moreparticular description of the invention briefly described above will berendered by reference to specific embodiments thereof which areillustrated in the appended drawings. Understanding that these drawingsdepict only typical embodiments of the invention and are not thereforeto be considered to be limiting of its scope, the invention will bedescribed and explained with additional specificity and detail throughthe use of the accompanying drawings in which:

FIG. 1A illustrates an example computer architecture that facilitatesproviding consistent tenant experiences at multi-tenant databases.

FIG. 1B illustrates an example of logical database views provided todynamic distributed database tenants.

FIG. 2 illustrates a flow chart of an example method for providingconsistent tenant experiences at multi-tenant databases.

FIG. 3 illustrates another example computer architecture thatfacilitates providing consistent tenant experiences at multi-tenantdatabases.

FIGS. 4A and 4B illustrate a more detailed flow chart of an examplemethod for importing data into a dynamic distributed database.

DETAILED DESCRIPTION

The present invention extends to methods, systems, and computer programproducts for providing consistent tenant experiences at multi-tenantdatabase. First data is accessed. The first data is associated with atenant of a dynamic distributed database system. The first data has aplurality of data portions, each having values (e.g., primary keyvalues) within one or more ranges of a database of the tenant. One ormore data portions, from among the plurality of data portions, areimported into the dynamic distributed database system.

For each of the one or more data portions, importing includes referringto a global partition map for the dynamic distributed database system toschedule the data portion for insertion into an appropriate database forthe tenant. The appropriate database for the tenant is at a node of thedynamic distributed database system.

Second data is accessed. The second data is associated with a secondtenant of the dynamic distributed database system. The second data hasvalues (e.g., primary key values) within one or more ranges of adatabase of the second tenant.

Import of the first data is suspended or throttled subsequent toaccessing the second data and prior to completing import of all of theplurality of data portions. Accordingly, one or more data portions, fromamong the plurality of data portions, remain to be processed.

Subsequent to suspending or throttling import of the first data into thedynamic distributed database system, a portion of the second data isimported into the dynamic distributed database system Importing theportion of second data includes referring to the global partition map toschedule the portion of the second data for insertion into appropriatedatabase for the second tenant. The appropriate database for the secondtenant is at a node of the dynamic distributed database system.

Embodiments of the present invention may comprise or utilize a specialpurpose or general-purpose computer including computer hardware, suchas, for example, one or more processors and system memory, as discussedin greater detail below. Embodiments within the scope of the presentinvention also include physical and other computer-readable media forcarrying or storing computer-executable instructions and/or datastructures. Such computer-readable media can be any available media thatcan be accessed by a general purpose or special purpose computer system.Computer-readable media that store computer-executable instructions arecomputer storage media (devices). Computer-readable media that carrycomputer-executable instructions are transmission media. Thus, by way ofexample, and not limitation, embodiments of the invention can compriseat least two distinctly different kinds of computer-readable media:computer storage media (devices) and transmission media.

Computer storage media (devices) includes RAM, ROM, EEPROM, CD-ROM,solid state drives (“SSDs”) (e.g., based on RAM), Flash memory,phase-change memory (“PCM”), other types of memory, other optical diskstorage, magnetic disk storage or other magnetic storage devices, or anyother medium which can be used to store desired program code means inthe form of computer-executable instructions or data structures andwhich can be accessed by a general purpose or special purpose computer.

A “network” is defined as one or more data links that enable thetransport of electronic data between computer systems and/or modulesand/or other electronic devices. When information is transferred orprovided over a network or another communications connection (eitherhardwired, wireless, or a combination of hardwired or wireless) to acomputer, the computer properly views the connection as a transmissionmedium. Transmissions media can include a network and/or data linkswhich can be used to carry desired program code means in the form ofcomputer-executable instructions or data structures and which can beaccessed by a general purpose or special purpose computer. Combinationsof the above should also be included within the scope ofcomputer-readable media.

Further, upon reaching various computer system components, program codemeans in the form of computer-executable instructions or data structurescan be transferred automatically from transmission media to computerstorage media (devices) (or vice versa). For example,computer-executable instructions or data structures received over anetwork or data link can be buffered in RAM within a network interfacemodule (e.g., a “NIC”), and then eventually transferred to computersystem RAM and/or to less volatile computer storage media (devices) at acomputer system. Thus, it should be understood that computer storagemedia (devices) can be included in computer system components that also(or even primarily) utilize transmission media.

Computer-executable instructions comprise, for example, instructions anddata which, when executed at a processor, cause a general purposecomputer, special purpose computer, or special purpose processing deviceto perform a certain function or group of functions. The computerexecutable instructions may be, for example, binaries, intermediateformat instructions such as assembly language, or even source code.Although the subject matter has been described in language specific tostructural features and/or methodological acts, it is to be understoodthat the subject matter defined in the appended claims is notnecessarily limited to the described features or acts described above.Rather, the described features and acts are disclosed as example formsof implementing the claims.

Those skilled in the art will appreciate that the invention may bepracticed in network computing environments with many types of computersystem configurations, including, personal computers, desktop computers,laptop computers, message processors, hand-held devices, multi-processorsystems, microprocessor-based or programmable consumer electronics,network PCs, minicomputers, mainframe computers, mobile telephones,PDAs, tablets, pagers, routers, switches, and the like. The inventionmay also be practiced in distributed system environments where local andremote computer systems, which are linked (either by hardwired datalinks, wireless data links, or by a combination of hardwired andwireless data links) through a network, both perform tasks. In adistributed system environment, program modules may be located in bothlocal and remote memory storage devices.

Embodiments of the invention can also be implemented in cloud computingenvironments. In this description and the following claims, “cloudcomputing” is defined as a model for enabling on-demand network accessto a shared pool of configurable computing resources. For example, cloudcomputing can be employed in the marketplace to offer ubiquitous andconvenient on-demand access to the shared pool of configurable computingresources. The shared pool of configurable computing resources can berapidly provisioned via virtualization and released with low managementeffort or service provider interaction, and then scaled accordingly.

A cloud computing model can be composed of various characteristics suchas, for example, on-demand self-service, broad network access, resourcepooling, rapid elasticity, measured service, and so forth. A cloudcomputing model can also expose various service models, such as, forexample, Software as a Service (“SaaS”), Platform as a Service (“PaaS”),and Infrastructure as a Service (“IaaS”). A cloud computing model canalso be deployed using different deployment models such as privatecloud, community cloud, public cloud, hybrid cloud, and so forth. Inthis description and in the claims, a “cloud computing environment” isan environment in which cloud computing is employed.

Embodiments of the invention include an import service that facilitatesdata imports without any distribution logic on a tenant. A tenant(caller) provides data in essentially any order. The import serviceunderstands the distribution of data across multiple databases anddetermines for any given piece of import data what database the importdata is to be inserted into. Accordingly, the tenant (caller) isrelieved from having to know how the data is distributed across a set(of potentially hundreds or thousands) of databases.

The import service can group sets of data destined for a given databasetogether and can use batch operations to increase efficiency. The importservice can understand the way data is allocated across databases (e.g.,as a result of online split operations and/or merge operations), howdatabases area placed on individual nodes (machines), movement ofdatabases between nodes (e.g., for load balancing or servicing), andwhat other operations are occurring during the import. The importservice can use this information to increase import efficiency as wellas increase resiliency to failures.

The import service can be aware of multi-tenancy and can optimize animport process to provide load balancing and fairness across a dynamicdistributed database system, such as, a cloud database system. Theimport service can insure that a large import by one tenant does notdeprive the import of another tenant of appropriate resources. Forexample, when an import for one tenant is detected as consuming anamount of resources that might degrade the import experience of one ormore other tenants, the import for the one tenant is suspended (stopped)or throttled (slowed down). As such, resources previously allocated forthe import can be reallocated for use in importing data for the one ormore other tenants. When resource consumption patterns subsequentlychange or through passage of time, the import can be resumed orthrottling can be removed.

FIG. 1A illustrates an example computer architecture 100 thatfacilitates providing consistent tenant experiences at multi-tenantdatabases. Referring to FIG. 1A, computer architecture 100 includesdatabase tenants 101 and dynamic distributed database system 106. Eachof database tenants 101 and dynamic distributed database system 106 canbe connected to one another over (or be part of) a network, such as, forexample, a Local Area Network (“LAN”), a Wide Area Network (“WAN”), andeven the Internet. Accordingly, each of database tenants 101 and dynamicdistributed database system 106 as well as any other connected computersystems and their components, can create message related data andexchange message related data (e.g., Internet Protocol (“IP”) datagramsand other higher layer protocols that utilize IP datagrams, such as,Transmission Control Protocol (“TCP”), Hypertext Transfer Protocol(“HTTP”), Simple Mail Transfer Protocol (“SMTP”), etc. or using othernon-datagram protocols) over the network.

As depicted, dynamic distributed database system 106 (e.g., a clouddatabase system) includes virtualization layer 107, maintenance modules111, monitor and notification module 112, and machines 114. Databasetenants 101 include tenants 102 and 103 (vertical ellipses indicate thatother tenants before, between, and after tenants 102 and 103 may exist).Each of tenants 102 and 103 can store data in one or more databasesmanaged by dynamic distributed database system 106. In general,virtualization layer 107 abstracts the underlying hardware, data layout,data storage locations, database locations, data movement, databasemovement, etc., within dynamic distributed database system 106 fromdatabase tenants. As such, each database tenant is essentially provideda logical view of a dedicated database.

Turning briefly to FIG. 1B, tenants 102 and 103 can be provided withlogical views of databases 192 and 193 respectively (even though datafor each tenants 102 and 103 can be stored on and moved betweendifferent databases and nodes of dynamic distributed database system106). Database tenants can interact with a provided logical view as ifinteracting with a dedicated database. For example, tenants 102 and 103can interact with logical views of databases 192 and 193 respectively asif interacting with individual dedicated databases. Tenants 102 and 103can do so even when tens, hundreds, or even thousands of other tenantsare also interacting with dynamic distributed database system 106through other abstracted logical views to store and access data.

Returning to FIG. 1A, machines 114 includes nodes 114A, 114B, etc.(vertical ellipses indicate that other tenants before, between, andafter nodes 114A, and 114B may exist). Each machine can include adatabase server (e.g., a SQL server). For example, nodes 114A, 114B,etc. include database servers 116A, 116B, etc., respectively. Eachdatabase server can maintain one or more databases for storing tenantdata. For example, database server 116A includes databases 116A1, 116A2,116A3, etc. Database server 116B includes databases 116B1, 116B2, 116B3,etc. Database servers can maintain virtually any number of databases andthe number of databases maintained by different database servers canvary. Further, data ranges for a plurality of different tenants can bestored at a database.

Maintenance modules 111 issue instructions to machines 114 to changeunderlying hardware, to change data layout, to change data storagelocations, to change database locations, to move data, to movedatabases, etc., For example, maintenance modules 111 can issueinstructions to move a data range for a tenant from one database toanother database, can issue instructions to merge data ranges for atenant at a database, can issue instructions to split a data range for atenant between a plurality of database, can issue instructions to move adatabase from one node to another node, etc. Maintenance modules 111 canissue instructions in an automated manner and/or can issue instructionsin response to instructions from administrators.

From time to time or at specified intervals, maintenance modules 111 canmonitor resource usage at nodes included machines 114 can issueinstructions to balance resource usage. For example, if one node isexperiencing higher resource usage, a portion of the data ranges and/ordatabases at the node can be moved to another node with lower resourceusage. If maintenance modules 111 detect a node or database failure,maintenance modules 111 can issue instructions to move appropriate dataranges and/or databases to other nodes. Maintenance modules 111 can alsoissue instructions to lock appropriate data ranges and/or databases sothat further data is not stored at failing components.

An administrator can also issue commands to maintenance modules 111. Forexample, an administrator can send commands to take down a specifiednode. In response, maintenance modules 111 can issue instructions tomove databases at the node to one or more other nodes. Likewise, anadministrator can flag a newly added node as available. In response,maintenance modules 111 can issue instructions to move databases fromone or more other nodes to the newly available node.

Accordingly, underlying hardware, data layout, data storage locations,database locations, etc. of machines 114 can change overtime. Ingeneral, partition map 131 maps data ranges to databases and databasesto nodes. For example, as depicted, partition map 131 includes datarange map 132 and database map 133.

On a per tenant basis, data elements in data range map 132 map dataranges for the tenant to a corresponding databases. For example, datarange map 132 includes data ranges to databases mappings for tenants102, 103, etc. Database map 133 maps databases to corresponding nodes.

In general, monitor and notification module 112 is configured to updatepartition map 131 as changes at machines 114 are detected. From time totime or at specified intervals, monitor and notification module 112 canpoll machines 114 to determine a configuration. In some embodiments,components of machines 114 notify monitor and notification module 112when a change occurs. For example, a node can notify monitor andnotification module 112 when a database is added to or removed from thenode. Similarly, a database server can notify monitor and notificationmodule 112 when a data range is added to or removed from a databasemaintained by the database server.

In response to detected changes and/or notifications, monitor andnotification module 112 can update partition map 131 as appropriate toindicate more recent configurations at machines 114. Monitor andnotification module 112 can add, delete, change, modify, etc., mappingsin data range map 132 and/or database map 133. For example, monitor andnotification module 112 can delete one data range to database mappingand add two new data range to database mappings when a data range issplit. On the other hand, monitor and notification module 112 can deletetwo data range to database mappings and add one new data range todatabase mapping when two data ranges are merged. Monitor andnotification module 112 can also remove, add, and modify database tonode mappings as movement of database between nodes is detected.

Virtualization layer 107 further includes resource management module 181and assignment module 109. Assignment module 109 is configured toreceive import data from a tenant and move the portions of the importdata (e.g., rows) into appropriate queues for storage in a database.Based on a data value (e.g., a primary key value) in a portion of data(e.g., a row) from a tenant, assignment module 109 can refer to a datarange map 132 for the tenant. From the data range map 132, assignmentmodule 109 can determine what data range includes the data value.Assignment module 109 can then refer to the corresponding database forthat data range. Assignment module 109 can then move the portion ofimport data to a queue for the node that hosts the correspondingdatabase.

Resource management module 181 is configured to monitor resourceconsumption patterns for data imports of tenants of dynamic distributeddatabase 106. Monitoring resource consumption patterns for data importscan include, for each tenant, monitoring the aggregate resourceconsumption for any data imports being performed for the tenant. Assuch, resource manager module 181 can determine when an amount ofresources being consumed for a tenant's imports are potentiallydegrading the data import experience for other tenants. For example,resource manager module 181 can determine when a particular tenant ishogging bandwidth such that other tenant's data imports are slow or notpossible.

Resource management module 181 can include algorithms to calculateaggregate resource consumption for tenants of dynamic distributeddatabase 106. Resource management module 181 can include algorithms fordetecting when resource consumption by one tenant is potentiallydegrading the import experience of one or more other tenants. Resourceconsumption thresholds can be used to detect when resource consumptionby one tenant is potentially degrading the import experience of one ormore other tenants. Resource management module 181 can also includealgorithms defining actions that can be taken when the resourceconsumption of one tenant potentially degrades the import experience ofone or more other tenants.

In some embodiments, the algorithms of resource management module 181are supplemented or even supplanted by import policy 118. Import policy118 can include rules for calculating aggregate resource consumption,rules for detecting when resource consumption by one tenant ispotentially degrading the import experience of one or more othertenants, and rules defining actions that can be taken when the resourceconsumption of one tenant potentially degrades the import experience ofone or more other tenants.

Defined actions can include temporarily suspending or throttling importof a first tenant's data until at least some data for one or more othertenants is successfully imported. Import of the first tenant's data canthen be resumed. For example, in some embodiments, resource managementmodule 181 suspends data import for a first tenant so that resources arefreed up for use in importing data for other tenants. The freed upresources can then be used to import data for other tenants. When dataimport for other tenants is complete, is detected as degrading theimport experience for further tenants, or through the passage of time,import of the first tenant's data can be resumed.

Thus, defined actions can include suspending or throttling import of atenant's data until it is detected that resources consumed by some othertenant is potentially degrading the import experience of one or morefurther tenants Import of the tenant's data can then be resumed. Forexample, in some embodiments, resource management module 181 suspends orthrottles data import for a first tenant so that resources are freed upfor use in importing data for other tenants. The freed up resources canthen be used to import data for other tenants. When it is detected thatresource consumption by a second tenant is potentially degrading theimport experience of one or more further tenants, import of the firsttenant's data can be resumed. Import of the one or more further tenant'sdata can possibly also continue.

As such, in some embodiments, resource management module 181 balancesresource allocation across a plurality of tenants to provide aconsistent import experience to each of the plurality of tenants. Toprovide a consistent import experience, resource management module 181can suspend/throttle and resume/unthrottle data imports for differenttenants from time to time based on calculated resource consumption ateach of the plurality of tenants. For example, resource managementmodule 181 can detect that a first tenant is consuming an amount ofresources potentially degrading the import experience of one or moreother tenants. Concurrently, resource management module 181 can alsodetect that a second tenant is consuming an amount of resourcespotentially degrading the import experience of the one or more othertenants. Resource management module 181 can suspend/throttle andresume/unthrottle data imports for the first and second tenants tobalance resource allocation between the first tenant, the second tenant,and the one or more other tenants. Suspending/throttling andresuming/unthrottling data imports for the first and second tenants canprovide a consistent user experience to the first tenant, the secondtenant, and the one or more other tenants.

Various time indicators, for example, t=0, t=1, t=2, etc., are depictedin the data elements of computer architecture 100. The depicted timeindicators are used to indicate the order for an occurrence of eventsrelative to one another with computer architecture 100. That is, thetime indicators are used to indicate that some events occur before orafter other events. Within these time indicators lower numbers aredefined to occur before higher numbers. For example, “t=1” occurs before“t=2”. Similarly, higher numbers are defined to occur after lowernumbers. For example, “t=7” occurs after “t=4”. However, it is to beunderstood that the depicted time indicators do not represent anymeasured passage of time either before, after, or between the depictedtime indicators. That is, no specified time measurements or specifictime periods are associated with the time indicators.

FIG. 2 illustrates a flow chart of an example method 200 for providingconsistent tenant experiences at multi-tenant databases. Method 200 willbe described with respect to the components and data of computerarchitecture 100.

Method 200 includes accessing first data, the first data associated witha tenant of a dynamic distributed database system, the first data havinga plurality of data portions, each of the plurality of data portionshaving values within one or more ranges of a database of the tenant(201). For example, virtualization layer 107 can access import data 121at t=0. Import data 121 is associated with tenant 102 and includes dataportions 121A, 121B, and 121C (e.g., rows of database). Each of dataportions 121A, 121B, and 121C have data values, for example, primary keyvalues with in one or more ranges of database for tenant 102.

Method 200 includes importing one or more data portions, from among theplurality of data portions, into the dynamic distributed database system(202). For example, data portions 121A and 121B can be imported intodynamic database system 106.

Importing one or more data portions includes for each of the one or moredata portions, referring to a global partition map for the dynamicdistributed database system to schedule the data portion for insertioninto an appropriate database for the tenant, the appropriate databasefor the tenant at a node of the dynamic distributed database system(203). For example, assignment module 109 can refer to data range 132map and database map 133 to determine that data portion 121A is to beinserted into a database at node 114A. Assignment module 109 canschedule data portion 121A into queue 117A at t=1. Similarly, assignmentmodule 109 can refer to data range 132 map and database map 133 todetermine that data portion 121B is to be inserted into a database atnode 114B. Assignment module 109 can schedule data portion 121B intoqueue 117B at t=2.

Method 200 includes accessing second data, the second data associatedwith a second tenant of the dynamic distributed database system, thesecond data having values within one or more ranges of a database of thesecond tenant (204). For example, virtualization layer 107 can accessimport data 122 at t=3 Import data 122 is associated with tenant 103 andincludes data portion 122A (e.g., a row of database). Data portion 122Acan have a data value, for example, a primary key value, within a rangeof a database for tenant 103.

Method 200 includes suspending import of the first data subsequent toaccessing the second data and prior to completing import of all of theplurality of data portions such that a one or more data portions, fromamong the plurality of data portions, remain to be processed (205). Forexample, resource management module 181 can suspend import of importdata 121 subsequent to accessing import data 122 and prior to completingimport of all of data portions 121A, 121B, 121C, etc. such that dataportion 121C and any other data portions in import data 121 remain to beprocessed.

Resource management module 181 can detect that tenant 102 is consumingan aggregate amount of resources that potential degrades the importexperience of tenant 103 (as well as other database tenants). Inresponse, resource management module 181 can send suspend command 141 toassignment module 109 at t=4. Suspend command 141 can instructassignment module 109 to suspend (i.e., stop) import of import data 121.Assignment module 109 can receive suspend command 141 from resourcemanagement module 181. Assignment module 109 can stop importing importdata 121 in response to receiving suspend command 141.

Alternately, method 200 includes throttling import of the first datasubsequent to accessing the second data and prior to completing importof all of the plurality of data portions such that a one or more dataportions, from among the plurality of data portions, remain to beprocessed (208). For example, resource management module 181 canthrottle import of import data 121 subsequent to accessing import data122 and prior to completing import of all of data portions 121A, 121B,121C, etc. such that data portion 121C and any other data portions inimport data 121 remain to be processed.

As described, resource management module 181 can detect that tenant 102is consuming an aggregate amount of resources that potential degradesthe import experience of tenant 103 (as well as other database tenants).In response, resource management module 181 can send a throttle commandto assignment module 109 at t=4. The throttle command can instructassignment module 109 to throttle (i.e., slow down) import of importdata 121. Assignment module 109 can receive throttle command 141 fromresource management module 181. Assignment module 109 can throttle (slowdown) importing import data 121 in response to receiving the throttlecommand.

Method 200 includes subsequent to suspending or throttling importing thefirst data into the dynamic distributed database system, importing aportion of the second data into the dynamic distributed database system(206). For example, subsequent to suspending or throttling import ofimport data 121, data portions 122A can be imported into dynamicdatabase system 106.

Importing a portion of the second data includes referring to the globalpartition map to schedule the portion of the second data for insertioninto appropriate database for the second tenant, the appropriatedatabase for the second tenant at a node of the dynamic distributeddatabase system (207). For example, assignment module 109 can refer todata range 132 map and database map 133 to determine that data portion122A is to be inserted into a database at node 114B. Assignment module109 can schedule data portion 122A into queue 117B at t=5.

Subsequent to importing data portion 122A, and possibly one or moreadditional portions of data in import data 122, resource managementmodule 181 can detect that import of import data 122 is complete.Alternately, subsequent to importing data portion 122A, and possibly oneor more additional portions of data in import data 122, resourcemanagement module 181 can detect that tenant 103 is consuming anaggregate amount of resources that potential degrades the importexperience of tenant 102 (as well as other database tenants).

In response, resource management module 181 can send suspend/resumecommand 142 to assignment module 109 at t=6. Suspend/resume command 142can instruct assignment module 109 to suspend import of import data 122and resume import of import data 121. Assignment module 109 can receivesuspend/resume command 142 from resource management module 181.Assignment module can stop importing import data 122 and resumeimporting import data 121 in response to receiving suspend/resumecommand 142.

Alternately, in response, resource management module 181 can send athrottle/resume command to assignment module 109 at t=6. Thethrottle/resume command can instruct assignment module 109 to throttleimport of import data 122 and unthrottle import of import data 121.Assignment module 109 can receive the throttle/resume command fromresource management module 181. Assignment module can throttle importingimport data 122 and unthrottle importing import data 121 in response toreceiving the throttle/resume command 142.

Further portions of import data 121 can then be imported into dynamicdatabase system 106. For example, assignment module 109 can refer todata range 132 map and database map 133 to determine that data portion121C is to be inserted into a database at node 114A. Assignment module109 can schedule data portion 121C into queue 117A at t=7.

Threads for queues 117A and 117B can dequeue data and store dequeueddata in appropriate databases at nodes 114A and 114B respectively.

FIG. 3 illustrates an example computer architecture 300 that facilitatesproviding consistent tenant experiences at multi-tenant databases.Referring to FIG. 1, computer architecture 300 includes database tenants301 and dynamic distributed database system 306. Each of databasetenants 301 and dynamic distributed database system 306 can be connectedto one another over (or be part of) a network, such as, for example, aLocal Area Network (“LAN”), a Wide Area Network (“WAN”), and even theInternet. Accordingly, each of database tenants 301 and dynamicdistributed database system 306 as well as any other connected computersystems and their components, can create message related data andexchange message related data (e.g., Internet Protocol (“IP”) datagramsand other higher layer protocols that utilize IP datagrams, such as,Transmission Control Protocol (“TCP”), Hypertext Transfer Protocol(“HTTP”), Simple Mail Transfer Protocol (“SMTP”), etc. or using othernon-datagram protocols) over the network.

As depicted, dynamic distributed database system 306 (e.g., a clouddatabase system) includes virtualization layer 307, maintenance modules311, monitor and notification module 312, and machines 314. Databasetenants 301 include tenants 302 and 303 (vertical ellipses indicate thatother tenants before, between, and after tenants 302 and 303 may exist).Each of tenants 302 and 303 can store data in one or more databasesmanaged by dynamic distributed database system 306. Similar tovirtualization layer 107, virtualization layer 307 abstracts theunderlying hardware, data layout, data storage locations, databaselocations, data movement, database movement, etc., within dynamicdistributed database system 306 from database tenants. As such, eachdatabase tenant is essentially provided a logical view of a dedicateddatabase.

Machines 314 include nodes 314A, 314B, etc. (vertical ellipses indicatethat other tenants before, between, and after nodes 314A and 314B mayexist). Each machine can include a database server (e.g., a SQL server).For example, nodes 314A, 314B, etc. include database servers 316A, 316B,etc., respectively Each database server can maintain one or moredatabases for storing tenant data. For example, database server 316Aincludes databases 316A1, 316A2, etc. Database server 316B includesdatabases 316B1, 316B2, etc. Database servers can maintain virtually anynumber of databases and the number of databases maintained by differentdatabase servers can vary. Further, data ranges for a plurality ofdifferent tenants can be stored at a database.

Maintenance modules 311 issue instructions to machines 314 to changeunderlying hardware, to change data layout, to change data storagelocations, to change database locations, to move data, to movedatabases, etc., For example, maintenance modules 311 can issueinstructions to move a data range for a tenant from one database toanother database, can issue instructions to merge data ranges for atenant at a database, can issue instructions to split a data range for atenant between a plurality of database, can issue instructions to move adatabase from one node to another node, etc. Maintenance modules 311 canissue instructions in an automated manner and/or can issue instructionsin response to instructions from administrators.

From time to time or at specified intervals, maintenance modules 311 canmonitor resource usage at nodes included machines 314 can issueinstructions to balance resource usage. For example, if one node isexperiencing higher resource usage, a portion of the data ranges and/ordatabases at the node can be moved to another node with lower resourceusage. If maintenance modules 311 detect a node or database failure,maintenance modules 311 can issue instructions to move appropriate dataranges and/or databases to other nodes. Maintenance modules 311 can alsoissue instructions to lock appropriate data ranges and/or databases sothat further data is not stored at failing components.

An administrator can also issue commands to maintenance modules 311. Forexample, an administrator can send commands to take down a specifiednode. In response, maintenance modules 311 can issue instructions tomove databases at the node to one or more other nodes. Likewise, anadministrator can flag a newly added node as available. In response,maintenance modules 311 can issue instructions to move databases fromone or more other nodes to the newly available node.

Accordingly, underlying hardware, data layout, data storage locations,database locations, etc. of machines 314 can change overtime. Ingeneral, partition map 331 maps data ranges to databases and databasesto nodes. For example, as depicted, partition map 331 includes datarange map 332 and database map 333.

On a per tenant basis, data elements in data range map 332 map dataranges for the tenant to a corresponding databases. As depicted, datarange map 332 includes data ranges to databases mappings for tenants 302and 303. Similar data range maps for any other tenants 301 can also beincluded in data range map 332. Database map 333 maps databases tocorresponding nodes.

In general, monitor and notification module 312 is configured to updatepartition map 331 as changes at machines 314 are detected. From time totime or at specified intervals, monitor and notification module 312 canpoll machines 314 to determine a configuration. In some embodiments,components of machines 314 notify monitor and notification module 312when a change occurs. For example, a node can notify monitor andnotification module 312 when a database is added to or removed from thenode. Similarly, a database server can notify monitor and notificationmodule 312 when a data range is added to or removed from a databasemaintained by the database server.

In response to detected changes and/or notifications, monitor andnotification module 312 can update partition map 331 as appropriate toindicate more recent configurations at machines 314. Monitor andnotification module 1312 can add, delete, change, modify, etc., mappingsin data range map 332 and/or database map 333. For example, monitor andnotification module 312 can delete one data range to database mappingand add two new data range to database mappings when a data range issplit. On the other hand, monitor and notification module 312 can deletetwo data range to database mappings and add one new data range todatabase mapping when two data ranges are merged. Monitor andnotification module 312 can also remove, add, and modify database tonode mappings as movement of database between nodes is detected.

Virtualization layer 307 further includes scheduler 308, assignmentmodule 309, and resource management module 381. Assignment module 309 isconfigured to receive import data from a tenant and move the portions ofthe import data (e.g., rows) into appropriate buckets 341. Based on adata value (e.g., a primary key value) in a portion of data (e.g., arow) from a tenant, assignment module 109 can refer to a data range map332 for the tenant. From the data range map 332, assignment module 309can determine what data range includes the data value. Assignment module309 can then refer to the corresponding database for that data range.Assignment module 309 can then move the portion of import data to abucket for the corresponding database.

Buckets 341 are configured to accumulate data until a specifiedcondition is satisfied. Buckets 341 can be configured to have aspecified size, such as, for example, bucket size 319. Specifiedconditions can include a bucket becoming full (i.e., the bucketcontaining data equal to or approaching the specified size) orexpiration of a recurring time period.

Scheduler 308 is configured to enqueue buckets into appropriate queuesand schedule queues for processing. As such, when a specified conditionis satisfied for a bucket, scheduler 308 can enqueue the bucket in aqueue for a node where the database is maintained. Each node can have aqueue. For example, nodes 314A, and 314B have queues 317A and 317Brespectively. Data can be dequeued from the queue in a specified mannerfor storage in the corresponding database. In some embodiments, eachnode has one or more threads that process the queue for the node.Scheduler 308 can schedule the one or more threads to dequeue data fromthe queue and store dequeued data in the corresponding database at thenode.

In some embodiments, scheduler 308 enqueues data when either a bucketbecomes full or a recurring time period expires. As such, buckets formore sparsely populated data ranges can still be processed with someregularity. Use of a recurring time period can help insure that data formore sparsely populated data ranges is imported even when acorresponding bucket would take longer than the recurring time period tofill.

Resource management module 381 is configured to monitor resourceconsumption patterns of tenant data imports for tenants of dynamicdistributed database 306. Monitoring tenant data imports can include,for each tenant, monitoring the aggregate resource consumption for anydata imports being performed for the tenant. As such, resource managermodule 381 can determine when an amount of resources being consumed fora tenant's imports are potentially degrading the data import experiencefor other tenants. For example, resource manager module 381 candetermine when a particular tenant is hogging bandwidth such that othertenant's data imports are slow or not possible.

Resource management module 381 can include algorithms to calculateaggregate resource consumption for tenants of dynamic distributeddatabase 106. Resource management module 381 can include algorithms fordetecting when resource consumption by one tenant is potentiallydegrading the import experience of one or more other tenants. Resourceconsumption thresholds can be used to detect when resource consumptionby one tenant is potentially degrading the import experience of one ormore other tenants. Resource management module 381 can also includealgorithms defining actions that can be taken when the resourceconsumption of one tenant potentially degrades the import experience ofone or more other tenants.

In some embodiments, the algorithms of resource management module 381are supplemented or even supplanted by import policy 318. Import policy318 can include rules for calculating aggregate resource consumption,rules for detecting when resource consumption by one tenant ispotentially degrading the import experience of one or more othertenants, and rules defining actions that can be taken when the resourceconsumption of one tenant potentially degrades the import experience ofone or more other tenants.

Defined actions can include suspending (stopping) or throttling (slowingdown) import of a tenant's data until at least some data for one or moreother tenants is successfully imported. Suspending import of a tenant'sdata can include suspending the placement of the tenant's data inbuckets and/or suspending the processing of the tenant's queued data.Throttling import of a tenant's data can include throttling theplacement of the tenant's data in buckets and/or throttling theprocessing of the tenant's queued data.

Import policy 318 can also define tenant resource thresholds, such as,for example, bucket size 319, bandwidth usage thresholds, memory usagethresholds, etc., for tenants importing data into dynamic distributeddatabase system 306.

Various time indicators, for example, t=0, t=1, t=2, etc., are depictedin the data elements of computer architecture 300. The depicted timeindicators are used to indicate the order for an occurrence of eventsrelative to one another within computer architecture 300. Althoughsimilarly defined, time indicators in computer architecture 300 are notassociated with the time indicators in computer architecture 100. Thatis, the time indicators are used to indicate that some events occurbefore or after other events. Within these time indicators lower numbersare defined to occur before higher numbers. For example, “t=1” occursbefore “t=2”. Similarly, higher numbers are defined to occur after lowernumbers. For example, “t=7” occurs after “t=4”. However, it is to beunderstood that the depicted time indicators do not represent anymeasured passage of time either before, after, or between the depictedtime indicators. That is, no specified time measurements or specifictime periods are associated with the time indicators.

At t=0, virtualization module 307 can access import data 321 at t=0.Import data 321 is associated with tenant 302 and includes rows 321A and321B (e.g., rows of database). Each of rows 321A and 321B, have datavalues, for example, primary key values with in one or more ranges ofdatabase for tenant 302. For example, row 321A can include a data value(e.g., primary key value) in data range 334. Assignment module 309 canrefer to data range map 332 for tenant 302 to determine that data range334 maps to database 316A2. Assignment module 309 can refer to databasemap 333 to determine that database 316A2 is hosted at node 314A. At t=1,assignment module 309 can move row 321 into bucket 342 (a bucket fornode 314A).

At t=2, virtualization module 307 can access import data 322. Importdata 322 is associated with tenant 303 and includes rows 322A and 322B(e.g., rows of database). Each of rows 322A and 322B, have data values,for example, primary key values with in one or more ranges of databasefor tenant 303. For example, row 322A can include a data value (e.g.,primary key value) in data range 336. Assignment module 309 can refer todata range map 332 for tenant 303 to determine that data range 336 mapsto database 316B1. Assignment module 309 can refer to database map 333to determine that database 316B1 is hosted at node 316A.

Subsequent to accessing import data 322, resource management module 381can detect that tenant 302 is consuming an aggregate amount of resourcesthat potential degrades the import experience of tenant 303 (as well asother database tenants). In response, resource management module 381 caninitiate suspending the import of import data 312.

However, at t=3, bucket 342, containing row 321A, can be queued intoqueue 317A.

At t=4, resource management module 381 can send suspend command 341 toscheduler 308 and/or assignment module 309. In some embodiments, suspendcommand 341 suspends both placing portions of import data 321 in bucketsand processing queued portions of import data 321. In other embodiments,suspend command 341 suspends placing portions of import data 321 inbuckets but processing of queued portions of import data 321 arepermitted to continue. In further embodiments, suspend command 341allows placing portions of import data 321 in buckets to continue butsuspends processing of queued portions of import data 321.

As depicted in FIG. 3, suspend command 341 instructs both scheduler 309to suspend the processing of any portions of import data 321 containedin queues and instructs assignment module 309 to suspend the placementof portions of import data 321 into buckets. Thus, in response tosuspend command 341, processing of bucket 342 from queue 317A issuspended and placement of row 321 into a bucket is suspended.

Alternately, at t=4, resource management module 381 can send a throttlecommand to scheduler 308 and/or assignment module 309. In someembodiments, the throttle command throttles both placing portions ofimport data 321 in buckets and processing queued portions of import data321. In other embodiments, the throttle command suspends placingportions of import data 321 in buckets but processing of queued portionsof import data 321 are permitted to continue at prior speeds. In furtherembodiments, the throttle command allows placing portions of import data321 in buckets to continue at prior speeds but throttles processing ofqueued portions of import data 321.

At t=5, assignment module 109 can move data portion 322A into bucket 343(a bucket for node 314B). At t=6, scheduler 308 can move bucket 343 intoqueue 317B. At t=7, a thread for queue 317B can dequeue and store row322A in a database 316B1. Thus, row 322A is imported into database316B1, while processing of import data 321 is suspended.

Subsequently, resource management module 381 can allow processing ofimport data 321 to resume or can unthrottle processing of import data321. For example, importing data for one or more other database tenants301 may complete. As such, additional resources are available. At t=8, athread for queue 317A can dequeue and store row 321A in database 316A2.At t=9, rows 321B and/or 322B can be moved into bucket 344 and laterqueue for processing. Resource management module 381 can allow import ofimport data 321 and 322 in parallel as resource availability permits.

In some embodiments, suspending and throttling an import are usedtogether. For example, importing data for a tenant can be throttled tofree up some resources. If importing the data is detected as degradingother tenant experiences when throttled, importing the data can besuspended. Similarly, resuming and unthrottling can be also be usedtogether. For example, when resuming import of data for a tenant (e.g.,after having been suspended), importing data can be resumed at athrottled rate. If further resources become available for importing thedata, importing the data can be unthrottled.

Accordingly, a resource management module can appropriately suspend,throttle, resume, and unthrottle imports across (a possibly large)plurality of tenants so as to more fairly allocate resources among theplurality of tenants. More fairly allocating resources helps insure thateach of the plurality of tenants is provided a consistent importexperience.

Embodiments of the invention can also be used to import data intostandalone non-federated databases.

FIG. 4 illustrates a more detailed flow chart of an example method 400for importing data into a dynamic distributed database.

In startup phase 410, method 400 includes a process start (411). As instartup phase 410, node placement data is loaded (412) and a federationto member node map is built (413). For example, monitor and notificationmodule 112 can build a partition map of a distributed dynamic database(e.g., a cloud database). The dynamic distributed database can thenbegin to wait for network input.

In import request phase 420, an import request containing reference toimport data can be received (421). The request can be authorized andvalidated (422). It can be determined if the target database isfederated (423).

If the database is non-federated (NO at 423), in a collate/bucket phase430, import data is split into buckets based on configured size forfairness (436). If the database is federated (YES at 423), in acollate/bucket phase 430, a range of arrays of federation members isbuilt from federation metadata (431). Federation metadata can include apartition map. In collate/bucket phase 430, N-rows of data can becollated using the range array (432). In collate/bucket phase 430, itcan be determined if import of a collection is complete or if bucketsize is greater than a configured limit (e.g., data contained in abucket is or is approaching a specified size) (433).

When a collection is not complete and a bucket size is not greater thana configured limit (NO at 433), collation continues (432). Whencollection is complete or a bucket size is greater than a configuredlimit (YES at 433), the range bucket is swapped with a new one and therange bucket is scheduled for processing (434). In collate/bucket phase430, the bucket is schedule for import (435). Collate/bucket phase 430can be performed by virtualization layer 307 (or other similarlyconfigured modules) through reference to a partition map (or othersimilarly configured data).

In a schedule phase 440, a target database for a bucket can bedetermined (441). In schedule phase 440, the node for a given databasecan be determined using a federation member to node map (442). Inschedule phase 440, the bucket can be inserted into a queue for a nodehosting the database or range (443). In schedule phase 440, the node isscheduled for execution (444). Schedule phase 440 can be performed byassignment module 309 and scheduler 308 (or other similarly configuredmodules) through reference to a partition map (or other similarlyconfigured data).

In an execute phase 450, for each hardware thread, a next node is pulledoff the queue (451). In execute phase 450, a next bucket for the threadis dequeued and import is started (452). In execute phase 450, it isdetermined if an import succeeded (453). If an import did not succeed(NO at 453), transition is made to a failure/recovery phase 460. If animport did succeed (YES at 453), the bucket is marked as complete in animport task (454).

In execute phase 450, it is determined if an import task is complete(455). If an import is not complete (NO at 455), it is determined if aconfigured number of buckets for a node have been imported (457). If animport is complete (YES at 455), the import task is marked as successful(456) and then it is determined if a configured number of buckets for anode have been imported (457). If a configured number of buckets for thenode have not been imported (NO at 457), a next bucket is dequeued forthe node and import is started (452). If a configured number of bucketsfor the node have not been imported (NO at 457), it is determined ifthere are buckets to process in the node queue (458). If there arebuckets to process in the node queue (YES at 458), the node is scheduledfor execution (444). If there are no buckets to process in the nodequeue (NO at 458), the next node is pulled off the queue (451). Executephase 450 can be performed by one or more threads under the control of adynamic distributed database system.

In failure/recovery phase 460, it is determined if an import waspartially successful (461). If the import was not partially successful(NO at 461), it is determined if there was a connection failure (463).If the import was partially successful (YES at 461), successfullyimported data is removed from the bucket (462) and then it is determinedif there was a connection failure (463). If there was a connectionfailure (YES at 463), it is determined if a retry count has been reached(464). If there was not a connection failure (NO at 463), it isdetermined if there was a range error (466).

If a retry count has not been reached (NO at 464), the node is scheduledfor execution (444). If a retry count has been reached (YES at 464), theimport is marked as failed (465). If there was no range error (NO at466), the import is also marked as failed (465). If there was a rangeerror (YES at 466), federation updates and member to node map updatesare looked up (467). Failure/recovery phase 460 includes reprocessingthe bucket data (468), including building a range of arrays offederation members is from federation metadata (431). Failure/recoveryphase 460 can be performed by assignment module 309 and scheduler 308(or other similarly configured modules) through reference to a partitionmap (or other similarly configured data).

The present invention may be embodied in other specific forms withoutdeparting from its spirit or essential characteristics. The describedembodiments are to be considered in all respects only as illustrativeand not restrictive. The scope of the invention is, therefore, indicatedby the appended claims rather than by the foregoing description. Allchanges which come within the meaning and range of equivalency of theclaims are to be embraced within their scope.

What is claimed:
 1. A distributed database system, the distributeddatabase system comprising: one or more processors; system memory; aplurality of nodes; a plurality of databases distributed across theplurality of nodes; a virtualization module, using the one or moreprocessors, configured to: initiate import of a one or more dataportions into the distributed database system, the one or more dataportions associated with a first tenant of the distributed databasesystem, including for each of the one or more data portions: schedulethe data portion for insertion into an appropriate database for thefirst tenant through reference to a partition map for the distributeddatabase system, the appropriate database for the first tenant includedin the plurality of databases; prior to completely importing the one ormore data portions, suspend importing of the one or more data portionsto free up resources for importing one or more other data portions tothe distributed database system, the one or more other data portionsassociated with a second different tenant of the distributed databasesystem; subsequent to suspending import of the one or more dataportions, initiate import of the one or more other data portions intothe distributed database system, including for each of the one or moreother data portions: schedule the other data portion for insertion intoan appropriate database for the second tenant through reference to thepartition map, the appropriate database for the first tenant included inthe plurality of databases.
 2. The distributed database system of claim1, wherein a virtualization module, using the one or more processors,configured to schedule the data portion for insertion into anappropriate database for the first tenant comprises a virtualizationmodule, using the one or more processors, configured to insert the dataportion into a bucket for the appropriate database for the first tenant,the bucket configured to accumulate data for a specified data range, adata value in the data portion being within the data range.
 3. Thedistributed database system of claim 2, wherein a virtualization module,using the one or more processors, configured to schedule the dataportion for insertion into an appropriate database for the first tenantcomprises a virtualization module, using the one or more processors,configured to insert the bucket into a queue, the queue corresponding toa node where the appropriate database for the first tenant is located,the node from among the plurality of nodes.
 4. The distributed databasesystem of claim 2, wherein a virtualization module, using the one ormore processors, configured to schedule the other data portion forinsertion into an appropriate database for the second tenant comprises avirtualization module, using the one or more processors, configured toinsert the other data portion into another bucket for the appropriatedatabase for the second tenant, the other bucket configured toaccumulate data for a specified other data range, a data value in theother data portion being within the other data range.
 5. The distributeddatabase system of claim 4, wherein a virtualization module, using theone or more processors, configured to schedule the other data portionfor insertion into an appropriate database for the second tenantcomprises a virtualization module, using the one or more processors,configured to insert the other bucket into another queue, the otherqueue corresponding to another node where the appropriate database forthe second tenant is located, the other node from among the plurality ofnodes.
 6. The distributed database system of claim 1, wherein avirtualization module, using the one or more processors, configured toschedule the data portion for insertion into an appropriate database forthe first tenant comprises a virtualization module, using the one ormore processors, configured to insert the data portion into a queue, thequeue corresponding to a node where the appropriate database for thefirst tenant is located, the node from among the plurality of nodes. 7.The distributed database system of claim 6, wherein a virtualizationmodule, using the one or more processors, configured to schedule theother data portion for insertion into an appropriate database for thesecond tenant comprises a virtualization module, using the one or moreprocessors, configured to insert the other data portion into anotherqueue, the other queue corresponding to another node where theappropriate database for the second tenant is located, the other nodefrom among the plurality of nodes.
 8. The distributed database system ofclaim 7, wherein the queue and the other queue are the same queue. 9.The distributed database system of claim 1, further comprising thevirtualization module, using the one or more processors, configured toresume importing the one or more data portions into the distributeddatabase system subsequent to importing the one or more other dataportions into the distributed database system.
 10. The method of claim1, wherein suspending importing of the one or more data portionscomprises suspending import of the one or more data portions inaccordance with an import policy, the import policy defining resourceusage thresholds for the first tenant and for the second tenant.
 11. Amethod for use at a computer system, the computer system including aprocessor and system memory, the method for providing a consistent userexperience when importing data into databases maintained by adistributed database system, the method comprising: initiating import ofa one or more data portions into the distributed database system, theone or more data portions associated with a first tenant of thedistributed database system, including for each of the one or more dataportions: scheduling the data portion for insertion into an appropriatedatabase for the first tenant through reference to a partition map forthe distributed database system; prior to completely importing the oneor more data portions, suspending importing of the one or more dataportions to free up resources for importing one or more other dataportions to the distributed database system, the one or more other dataportions associated with a second different tenant of the distributeddatabase system; subsequent to suspending importing the one or more dataportions, initiating import of the one or more other data portions intothe distributed database system, including for each of the one or moreother data portions: scheduling the other data portion for insertioninto an appropriate database for the second tenant through reference tothe partition map.
 12. The method of claim 11, wherein scheduling thedata portion for insertion into an appropriate database for the firsttenant comprises: inserting the data portion into a bucket for theappropriate database for the first tenant, the bucket configured toaccumulate data for a specified data range, a data value in the dataportion being within the data range; and inserting the bucket into aqueue, the queue corresponding to a node of the distributed databasesystem where the appropriate database for the first tenant is located.13. The method of claim 12, wherein scheduling the other data portionfor insertion into an appropriate database for the second tenantcomprises: inserting the other data portion into another bucket for theappropriate database for the second tenant, the other bucket configuredto accumulate data for a specified other data range, a data value in theother data portion being within the other data range; and inserting theother bucket into another queue, the other queue corresponding to a nodeof the distributed database system where the appropriate database forthe second tenant is located.
 14. The method of claim 11, whereinscheduling the data portion for insertion into an appropriate databasefor the first tenant comprises inserting the data portion into a queue,the queue corresponding to a node of the distributed database systemwhere the appropriate database for the first tenant is located; andwherein scheduling the other data portion for insertion into anappropriate database for the second tenant comprises inserting the otherdata portion into another queue, the other queue corresponding to a nodeof the distributed database system where the appropriate database forthe second tenant is located.
 15. The method of claim 14, wherein thequeue and the other queue are the same queue.
 16. The method of claim11, further comprising resuming importing the one or more data portionsinto the distributed database system subsequent to importing the one ormore other data portions into the distributed database system.
 17. Themethod of claim 11, wherein suspending importing of the one or more dataportions comprises suspending import of the one or more data portions inaccordance with an import policy, the import policy defining resourceusage thresholds for the first tenant and for the second tenant.
 18. Amethod for use at a computer system, the computer system including aprocessor and system memory, the method for providing a consistent userexperience when importing data into databases maintained by adistributed database system, the method comprising: initiating import ofa one or more data portions into the distributed database system, theone or more data portions associated with a first tenant of thedistributed database system, including for each of the one or more dataportions: scheduling the data portion for insertion into an appropriatedatabase for the first tenant through reference to a partition map forthe distributed database system; prior to completely importing the oneor more data portions, throttling import of the one or more dataportions to free up resources for importing one or more other dataportions to the distributed database system, the one or more other dataportions associated with a second different tenant of the distributeddatabase system; subsequent to throttling import the one or more dataportions, initiating import of the one or more other data portions intothe distributed database system, including for each of the one or moreother data portions: scheduling the other data portion for insertioninto an appropriate database for the second tenant through reference tothe partition map.
 19. The method of claim 18, further comprisingunthrottling import of the one or more data portions into thedistributed database system subsequent to importing the one or moreother data portions into the distributed database system.
 20. The methodof claim 18, wherein throttling import of the one or more data portionscomprises throttling import of the one or more portions of data inaccordance with an import policy, the import policy defining resourceusage thresholds for the first tenant and for the second tenant.